import request from '@/utils/request'
import qs from 'qs'

const officialWebsiterService = {
  state: {},

  mutations: {},

  actions: {
    client({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/client.action',
          method: 'GET',
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    clientDetail({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/clientDetail.action',
          method: 'GET',
          params:{id:params.id}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    solution({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/solution.action',
          method: 'GET',
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    solutionDetail({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/solutionDetail.action',
          method: 'GET',
          params:{id:params.ids}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    technologyService({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/technologyService.action',
          method: 'GET',
          params:{}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    technologyServiceDetail({ commit },params) {
    return new Promise((resolve, reject) => {
      request({
        url: '/manager/officialWebsite/technologyServiceDetail.action',
        method: 'GET',
        params:{id:params.id}
      }).then(response => {
        const data = response;
        resolve(data)
      }).catch(error => {
        reject(error)
      })
    })
  },
    news({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/news.action',
          method: 'GET',
          params:{}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    newsDetail({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/newsDetail.action',
          method: 'GET',
          params:{id:params.id}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    footData({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/footData.action',
          method: 'GET',
          params:{}
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
    createReauirement({ commit },params) {
      return new Promise((resolve, reject) => {
        request({
          url: '/manager/officialWebsite/createReauirement.action',
          method: 'POST',
          params:params
        }).then(response => {
          const data = response;
          resolve(data)
        }).catch(error => {
          reject(error)
        })
      })
    },
  }
}

export default officialWebsiterService
